<template>
	<div class="hot">
		<h2><span>TOP 10</span>      热门文章</h2>
		<ul>
			<li v-for="(list,index) in res" :key="list.id">
				<router-link  to="">
					<span :class="{ orange: index < 3 }">{{ index+1 }}</span>
					{{ list.title }}
				</router-link>
			</li>
		</ul>
	</div>
</template>

<script>
	// 模拟到的数据
	let resData = [{
			"id": "1",
			"title": "PHP学科，MySQL手册免费分享"
		},
		{
			"id": "2",
			"title": "前端必学框架 Bootsrap 3天入门"
		},
		{
			"id": "3",
			"title": "PHP进阶：要想提高PHP的编程效率"
		},
		{
			"id": "4",
			"title": "这是第一篇文章"
		},
		{
			"id": "5",
			"title": "想少走弯路，就看看这个贴"
		},
		{
			"id": "6",
			"title": "最涨薪的PHP项目-PHP微信公众号"
		}
	]
	export default {
		data() {
			return {
				res: resData
			}
		}
	}
</script>

<style scoped>
	.hot {
		background: #fff;
		margin-bottom:-30px ;
		line-height: 24px;
	}

	ul {
		padding: 0;
		list-style: none;
		margin-top: -15px;
	}

	a {
		color: #000;
		text-decoration: none;
	}

	.orange {
		color: orange;
	}
	span{
			font-style: italic;
		}
		li{
			margin-bottom: 10px;
		}
</style>
